C语言编程题目`-----我不要算法`我知道代码

来源:百度知道 编辑:UC知道 时间:2024/05/17 03:56:36
一个这样的题目
我输入一个小数,例如0.11000369
输出的是零点一一零零零三六九

就是把小写的数字改变成汉字输出;
用C语言编写~

请注意我只要代码,不要算法`算法我有`就是实现的时候出错.还有就是没有执行检查过的代码请不要乱发~强烈鄙视回答问题不负责任的人`

//VC++6.0编绎器下调试通过。C语言编写
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void main()
{
char input[15];
double ff=0.0;
memset(input, 0, sizeof(input));
printf("输入Ctrl+Z退出\n");
while (1)
{
printf("请输入一个浮点数: ");
fflush(stdin);
if (!gets(input))
break;
char* buf=NULL;
if ((0!=(ff=strtod(input,&buf)))&&!buf[0])
{
int i=0;
while (input[i])
{
switch (input[i])
{
case '0':
printf("零");
break;
case '1':
printf("一");
break;
case '2':
printf("二");
break;
case '3':
printf("三");
break;
case '4':
printf("四");
break;
case '5':
printf